package safe.yunchexing.com.cloudsafe.mvp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

/**
 * @author lixiaoming
 * @describe 所有Fragment的基类.
 */
public class BaseFragment extends Fragment implements IUI {

    private boolean isDestoryed;
    private boolean isDetached;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        isDetached = false;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        isDestoryed = false;
    }


    @Override
    public void onDestroy() {
        isDestoryed = true;
        super.onDestroy();
    }

    @Override
    public void onDetach() {
        isDetached = true;
        super.onDetach();
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }

    @Override
    public boolean isDestoryed() {
        return isDestoryed;
    }

}
